package Day217;

public class getMaxOfArray1 {
    public static void main(String[] args) {
        int[] a={3,89,72,37,58};
        int max=aMax(a);
        System.out.println("max="+max);

        int[] b=new int[10];
        for(int i=0;i<b.length;i++){
            b[i]=(int)(Math.random()*100);
            System.out.print(b[i]+"\t");
        }
        System.out.println();
        int c=aMax(b);
        System.out.println(c);

    }
    public static int aMax(int[] a){
        int max=a[0];
        for(int i=0;i<a.length;i++){
            if(a[i]>max){
                max=a[i];
            }
        }
        return max;
    }















}
